<?php session_start();?><!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <LINK REL=StyleSheet HREF="maintenancePagesCSS.css" TYPE="text/css" />
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>
        <center>
        <table width="1000" height="520" border="0" background="images/background.jpg">
          <tr>
            <th height="301" bgcolor="#454343" scope="col"><p><img src="images/TitleUserLIst.gif" alt="User List" width="514" height="67"></p>
            <table width="500" border="0" align="center">
              <tr>
                <th scope="col"><table align="center" class="SelectTable">
                    <tr>
                      <th colspan="2">Edit</th>
                      <th> Last Name </th>
                      <th> First Name </th>
                      <th> User Id </th>
                      <th> User Role </th>
                    </tr>
                    <?php
                    include "EmployeeDao.php";
                    include "Datasource.php";
                    include "Employee.php";
                    $objEmployeeDAO = new EmployeeDao();
                     $objDatasource = new Datasource("localhost", "theanykey", "root", "");
                    $results = $objEmployeeDAO->loadAll($objDatasource);
                    foreach($results as $objEmp)
                    {
                        $lastName = $objEmp->getLastName();
                        $firstName = $objEmp->getFirstName();
                        $role = $objEmp->getRole();
                        $userID = $objEmp->getLoginID();
                        $pk = $objEmp->getEmpID();
                        print("<tr align='center'>
                                <td>
                                    <a href='EditEmployee.php?id=$pk'>Edit</a>
                                </td>
                                <td>
                                    <a href='DeleteEmployee.php?id=$pk'>Delete</a>
                                </td>
                                <td>
                                    $lastName
                                </td>
                                <td>
                                    $firstName
                                </td>
                                <td>
                                    $userID
                                </td>
                                <td>
                                    $role
                                </td>
                                </tr>");
                    }
                ?>
                  </table></th>
              </tr>
            </table>
              <h3>
                <script src="links.js" language="javascript" type="text/javascript"></script>
                <script type="text/javascript">
            writeEmployeeLinks("", "");
                </script>
              </h3>            </th>
          </tr>
          <tr>
            <th height="213" bgcolor="#454343" scope="col">&nbsp;</th>
          </tr>
        </table>
        <h3>&nbsp;</h3>
        </center>
    </body>
</html>
